<html lang="zh-CN">
<?php
 	session_start();

?>
  <head>
  	 <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.js"></script>
    <script type="text/javascript" src="js/npm.js"></script>
    <script type="text/javascript" src="js/myjs.js"></script>
  </head>

<div class="container">
    <div class="row">
    <h1 class="text-center">欢迎登陆聊天室</h1>
<form class="form-horizontal" action="loginController.php" method="post">
        <div class="form-group">
          <label for="inputUserName" class="col-sm-offset-2 col-sm-2 control-label">用户名：</label>
          <div class="col-sm-4">
            <input type="text" class="form-control" id="username" name="username">
          </div>
        </div>
        <div class="form-group">
          <label for="inputPassword" class="col-sm-offset-2 col-sm-2 control-label">密码：</label>
          <div class="col-sm-4">
            <input type="password" class="form-control" id="password" name="password">
          </div>
        </div>
         <div class="form-group <?php if(!empty($_SESSION['login_err'])) echo 'has-error'; ?>">
          <label for="inputYzm" class="col-sm-offset-2 col-sm-2 control-label">验证码：</label>
          <div class="col-sm-3">
            <input type="text" class="form-control" id="CAPTCHA" name="captcha">
          </div>
          <div class="col-sm-1">
           	<img id="captcha" src="validate.php" border="1" onClick="refreshimage()">
          </div>
          <label for="res_login" class="col-sm-2 control-label"><?php if(!empty($_SESSION['login_err'])) {echo $_SESSION['login_err']; unset($_SESSION['login_err']);}?></label>
        </div>
        <div class="form-group">    
          <div class="col-xs-offset-4 col-sm-2">
            <button type="submit" class="btn btn-primary">登录</button>
          </div>
          <div class="col-sm-2">
            <a href="#" class="btn btn-primary" role="button" onClick="window.location='register.php';">注册</a>
        </div>
          </div>
 </form>
 </div>
 </div>
</html>